<?php
	include_once("../model/Acesso.class.php");
	include_once("../model/Mensagem.class.php");
 	include_once("../model/Funcionario.class.php");
	include_once("../model/Grupo.class.php");

	$acesso = new Acesso();
	$funcionario = new Funcionario();
	$grupo = new Grupo();
	$codigoPagina = "6";
	if ($acesso->verificaPermissaoUsuario($codigoPagina)){
		$banco = $acesso->getBanco();
		//$id_funcionario = $_REQUEST["funcionario"];
		//$temp = $funcionario->getDadosFuncionario($banco,$id_funcionario);
		//$dados_funcionario = mysql_fetch_row($temp); 
?>
<html>
<head>
<title>:.:.:INGECAMP:.:.:</title>
<link href="../arquivosExtra/estilo.css" rel="stylesheet" type="text/css">
<style type="text/css">
	body{
		background-color:#FFFFFF;
		background-image:none;
	}
</style>
<script language="javascript" src="../arquivosExtra/funcoesJavaScript.js"></script>





</head>

<body topmargin="0" leftmargin="0">
<table width="100%" border="2" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#CCCCCC" class="letraCabecalho">SIG-INGECAMP- Sistema de Gerenciamento Geral - INGECAMP - Via Internet</td>
  </tr>
  <tr>
    <td height="21" align="center" valign="top">
<table width="100%" border="0" cellspacing="0">
        <tr> 
          <td height="57" valign="bottom"><table width="100%" border="0" cellspacing="0">
              <tr> 
                <td height="26" colspan="5" align="center" class="letraCampo"><img src="../imagens/logo.jpg" width="569" height="96"></td>
              </tr>
              <tr> 
                <td height="22" valign="bottom">&nbsp;</td>
                <td colspan="2" valign="middle">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td valign="bottom">&nbsp;</td>
              </tr>
              <tr> 
                <td width="12%" height="39" valign="bottom">&nbsp;</td>
                <td width="61%" valign="middle"> <div align="right"> 
                    <input type="button" name="Submit2" value="Pagina Principal" class="botaoUsuario2" onClick="Redireciona()">
                  </div></td>
                <td width="2%" valign="middle">&nbsp;</td>
                <td width="11%" valign="middle"><div align="center"> 
                    <input type="button" name="Submit223" value="Logoff" class="botaoUsuario2" onClick="formLogoff()">
                  </div></td>
                <td width="14%" valign="bottom">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
      <form name="form1" id="form1" method="post" action="../control/controlCadUsuario.php">
        <table width="800" height="42" border="2" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="23%" height="21" bgcolor="#CCCCCC" class="letraCabecalho"> 
              <div align="center" class="letraCabecalho">Cadastro de Usu&aacute;rios</div></td>
          </tr>
          <tr> 
            <td height="20" align="left" valign="top">
            <table width="100%" border="0">
                <tr> 
                  <td height="30" align="right"><table width="100%" border="0">
                    
                    <tr>
                    
                    <td width="23%" height="33" align="right"><span class="letraCampo">Funcionario:</span></td>
                      <td width="23%"><select name="funcionario" class="caixaTexto" id="funcionario">
                      <?php
					  	$func = $funcionario->getAllFuncionario($banco);
						while($temp = mysql_fetch_row($func)){
							echo("<option value=\"$temp[0]\">$temp[1]</option>");
						}
                      ?>
                      </select></td>
                      <td width="20%" align="right"><span class="letraCampo">Login:</span></td>
                      <td width="34%"><input name="login" type="text" id="login" size="20" maxlength="20" class="caixaTexto" onBlur="verificarlogin()">
                        <input name="logins" type="text" id="logins" size="20" maxlength="20" class="caixaTextoSemBorda" readonly="readonly" disabled="disabled"></td>
                    </tr>
                        <tr>
                      <td width="23%" height="31" align="right"><span class="letraCampo">Senha:</span></td>
                      <td width="23%"><input name="senha" type="password" id="senha" size="20" maxlength="20" class="caixaTexto">
                      </td>
                        <td width="20%" align="right" height="31"><span class="letraCampo">Confirmar Senha:</span></td>
                      <td width="34%"><input name="confirmar_senha" type="password" id="confirmar_senha" size="20" maxlength="20" class="caixaTexto">
                      </td>
                      </tr>
                        <tr>
                      <td width="23%" height="37" align="right"><span class="letraCampo">Grupo:</span></td>
                      <td width="23%"><select name="grupo" class="caixaTexto" id="grupo">
                      <?php
					  	$grup = $grupo->getAllGrupo($banco);
						while($temp = mysql_fetch_row($grup)){
							echo("<option value=\"$temp[1]\">$temp[1]</option>");
						}
                      ?>
                      </select></td><td></td><td></td>
                      
                      
                    </tr> 
                    <tr><td height="27" colspan="4">
                     <div id="observacao" name="observacao">
                  	
                    </div>
                    
                    </td></tr>
                  </table>
              </table>
             </td>
          </tr>
          <tr> 
            <td height="1" align="left" valign="top"> <div align="center"> 
                <table width="100%" border="0">
                  <tr> 
                    <td align="right"><input type="button" name="Submit3" value="Cadastrar" onClick="verificarsenha()" class="botoes"></td>
                    <td>&nbsp;</td>
                    <td> <input type="button" name="Submit3" value="Cancelar" class="botoes" onClick="Redireciona()"></td>
                  </tr>
                </table>
              </div></td>
          </tr>
        </table>
        <p>&nbsp;</p>
     </form>
      <p>&nbsp;</p>
  </tr>
  <tr>
    <td height="1" bgcolor="#CCCCCC"><table width="100%" border="0" cellspacing="0">
        <tr> 
           <td width="302" align="right"> 
            <input name="textfield" type="text" class="informacoesLogin" value="Usu&aacute;rio:  <?php $x = $acesso->getLoginUsuarioLogado(); echo("$x"); ?>" readonly="readonly"> 
          </td>
          <td width="17">&nbsp;</td>
          <td width="144"><input name="textfield2" type="text" class="informacoesLogin" value="Entrada &agrave;s:  <?php $y = $acesso->getHoraAcesso(); echo("$y"); ?>" readonly="readonly"></td>
          <td width="17">&nbsp;</td>
          <td width="303">
<input name="textfield22" type="text" class="informacoesLogin" value="Data: <?php $z = $acesso->getDataAcesso(); echo("$z"); ?>" readonly="readonly">
          </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<?php
}else{
		$msg = new Mensagem();
		$msg->informaMensagem(005,$acesso->getPaginaPrincipal());
}?>